import type { App } from 'vue'
import { Button, MassContentEditor, UseEmojiOption } from './components'

// 基础样式（组件库自身）
import './styles/index.css'

// 依赖样式：确保 Element Plus 组件样式生效
// 解决在宿主项目未主动引入时，Tabs/TabPane 等样式丢失导致纵向堆叠的问题
import 'element-plus/dist/index.css'

// Material 组件的定制样式（覆盖和补充）
import './components/Material/styles/index.scss'

// 导出Material组件
export * from './components/Material'

// 导出 MassContentEditor 组件和类型
export { Button, MassContentEditor, UseEmojiOption }
export type {
  ContentItem,
  ButtonInfo,
  MessageDisplayItem,
  MessageType as MassContentEditorMessageType,
} from './components'
export {
  MassSendTaskContentType,
  MassSendTypeToMessageType,
  getMessageTypeFromMassSendType,
  DEFAULT_BUTTONS,
} from './components'

// 所有组件列表
const components = [Button, MassContentEditor, UseEmojiOption]

// 定义install方法，支持全量引入
const install = (app: App) => {
  components.forEach(component => {
    if (component && typeof component.install === 'function') {
      component.install(app)
    }
  })
}

// 支持全量引入
export default {
  install,
  Button,
  UseEmojiOption,
}

// 版本信息
export const version = '1.1.2'
